//
//  AllenThirdLandinView.m
//  自做商城项目
//
//  Created by allenL on 2017/6/23.
//  Copyright © 2017年 tam. All rights reserved.
//

#import "AllenThirdLandinView.h"

@interface AllenThirdLandinView()
@property (strong, nonatomic) UIButton *qqLoginBtn;  /** qq登录*/
@property (strong, nonatomic) UIButton *WXLoginBtn;  /** 微信登录*/
@property (strong, nonatomic) UIButton *sinaLoginBtn;  /** 新浪登录*/
@property (strong, nonatomic) UILabel *oneLogin;  /** 一键登录*/
@property (strong, nonatomic) UILabel *lineLable;  /** 分割线*/
@end


@implementation AllenThirdLandinView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.lineLable];
        [self addSubview:self.oneLogin];
        [self addSubview:self.qqLoginBtn];
        [self addSubview:self.WXLoginBtn];
        [self addSubview:self.sinaLoginBtn];
    }
    return self;
    
}
-(UILabel *)oneLogin{
    if (!_oneLogin) {
        _oneLogin = [[UILabel alloc]init];
        _oneLogin.text = @"一键登录";
        _oneLogin.textColor = RGB(190, 190, 190);
        _oneLogin.backgroundColor = MainColor;
        _oneLogin.textAlignment = NSTextAlignmentCenter;
        _oneLogin.font = [UIFont systemFontOfSize:16.0];
    }
    return _oneLogin;
}

-(void)layoutSubviews{
    [self superview];
    __weak typeof (self) weakSelf = self;
    
    [_oneLogin mas_makeConstraints:^(MASConstraintMaker *make){
        make.size.mas_equalTo(CGSizeMake(80 , 20));
        make.centerX.equalTo(weakSelf.mas_centerX);
        make.top.equalTo(weakSelf.mas_top).offset(0);
        
    }];
    [_WXLoginBtn mas_makeConstraints:^(MASConstraintMaker *make){
        make.top.equalTo(weakSelf.oneLogin.mas_bottom).offset(20);
        make.size.mas_equalTo(CGSizeMake(45 , 45));
        make.centerX.equalTo(weakSelf.mas_centerX);
        
    }];
    [_qqLoginBtn mas_makeConstraints:^(MASConstraintMaker *make){
        make.top.equalTo(weakSelf.oneLogin.mas_bottom).offset(20);
        make.size.mas_equalTo(CGSizeMake(45 , 45));
        make.right.equalTo(weakSelf.WXLoginBtn.mas_left).offset(-([[UIScreen mainScreen] bounds].size.width - 135)/4);
        
    }];
    [_sinaLoginBtn mas_makeConstraints:^(MASConstraintMaker *make){
        make.top.equalTo(weakSelf.oneLogin.mas_bottom).offset(20);
        make.size.mas_equalTo(CGSizeMake(45 , 45));
        make.left.equalTo(weakSelf.WXLoginBtn.mas_right).offset(([[UIScreen mainScreen] bounds].size.width - 135)/4);
    }];
    [_lineLable mas_makeConstraints:^(MASConstraintMaker *make){
        make.centerY.equalTo(weakSelf.oneLogin.mas_centerY);
        make.height.equalTo(@1);
        make.left.equalTo(weakSelf.mas_left).offset(16);
        make.right.equalTo(weakSelf.mas_right).offset(16);
    }];
    


}

-(UIButton *)qqLoginBtn{
    if (!_qqLoginBtn) {
        _qqLoginBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [_qqLoginBtn setImage:[UIImage imageNamed:@"登录界面qq登陆"] forState:(UIControlStateNormal)];
        
    }
    return _qqLoginBtn;
    
}


-(UIButton *)WXLoginBtn{
    if (!_WXLoginBtn) {
        _WXLoginBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [_WXLoginBtn setImage:[UIImage imageNamed:@"登录界面微信登录"] forState:(UIControlStateNormal)];
        
    }
    return _WXLoginBtn;
    
}

-(UIButton *)sinaLoginBtn{
    if (!_sinaLoginBtn) {
        _sinaLoginBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [_sinaLoginBtn setImage:[UIImage imageNamed:@"登陆界面微博登录"] forState:(UIControlStateNormal)];
        
    }
    return _sinaLoginBtn;
    
}

-(UILabel *)lineLable{
    if (!_lineLable) {
        _lineLable = [[UILabel alloc]init];
        _lineLable.backgroundColor = RGB(190, 190, 190);
    }
    return _lineLable;
    
}


@end
